package com.xckj.controller.run.project;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.adrninistrator.jacg.runner.RunnerWriteDb;
import com.xckj.entity.JacgSpringController;
import com.xckj.service.JacgAllowedClassPrefixService;
import com.xckj.utils.ReturnT;

@RestController
@RequestMapping(value = "/runnerWrite")
public class RunnerWriteController {
	
	@Autowired
	JacgAllowedClassPrefixService jacgAllowedClassPrefixService;
    /**
    * 新增
    * @author yanchf
    * @date 2023/12/03
    **/
    @RequestMapping("/writeDB")
    public Object writeDB(JacgSpringController jacgSpringController){
    	Map<String,Object> map = jacgAllowedClassPrefixService.pageList(0, 10);
    	if(map.size() > 0) {
            return ReturnT.success();
    	}
        boolean isSucc = new RunnerWriteDb().run();
        return ReturnT.success(isSucc);
    }
}
